package mobileserver;

/**
 * the class of IdGenerator
 * is used to generate sequence
 * int number.
 * The class has only one instance
 * @author wangkaidi
 *
 */
public class IdGenerator 
{
	private static IdGenerator instance;
	private IdGenerator()
	{
		
	}
	
	public synchronized static IdGenerator getInstance()
	{
		if(instance==null)
		{
			instance=new IdGenerator();
		}
		return instance;
	}
	
	private int value=0;
	public int getNext()
	{
		return ++value;
	}
}
